]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
main: Notify about shutdown before tearing down
authorJonas Ådahl <jadahl@gmail.com>
Wed, 17 Aug 2022 14:27:09 +0000 (16:27 +0200)
committerJonas Ådahl <jadahl@gmail.com>
Fri, 25 Nov 2022 21:09:37 +0000 (22:09 +0100)
This will allow the shell to tear things down more gracefully.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1349>

src/main.c
src/shell-global-private.h
src/shell-global.c

index 29275cda0725f02de6bf4d6b3e42aff5211cafcf..468e588493e08300787abd5d54734a9f518be675 100644 (file)
@@ -585,6 +585,9 @@ main (int argc, char **argv)
       ecode = EXIT_FAILURE;
     }
 
+  g_message ("Shutting down GNOME Shell");
+  _shell_global_notify_shutdown (shell_global_get ());
+
   meta_context_destroy (g_steal_pointer (&context));
 
   shell_profiler_shutdown ();
index 9969691cb47db09ae5c81f043cc609e80f4aa645..a0834af8e28d33d5f4fbef910395bd91bc884537 100644 (file)
@@ -20,4 +20,6 @@ gboolean _shell_global_check_xdnd_event (ShellGlobal  *global,
 
 void _shell_global_locate_pointer (ShellGlobal  *global);
 
+void _shell_global_notify_shutdown (ShellGlobal *global);
+
 #endif /* __SHELL_GLOBAL_PRIVATE_H__ */
index ab8000e2385dab67bda1240ecbe4efff3e7f84a5..365e387f0a3d45e773e7be59254ef9d0f7e67003 100644 (file)
@@ -120,6 +120,7 @@ enum
 {
  NOTIFY_ERROR,
  LOCATE_POINTER,
+ SHUTDOWN,
  LAST_SIGNAL
 };
 
@@ -507,6 +508,13 @@ shell_global_class_init (ShellGlobalClass *klass)
                     0,
                     NULL, NULL, NULL,
                     G_TYPE_NONE, 0);
+  shell_global_signals[SHUTDOWN] =
+      g_signal_new ("shutdown",
+                    G_TYPE_FROM_CLASS (klass),
+                    G_SIGNAL_RUN_LAST,
+                    0,
+                    NULL, NULL, NULL,
+                    G_TYPE_NONE, 0);
 
   props[PROP_SESSION_MODE] =
     g_param_spec_string ("session-mode",
@@ -1872,3 +1880,9 @@ _shell_global_locate_pointer (ShellGlobal *global)
 {
   g_signal_emit (global, shell_global_signals[LOCATE_POINTER], 0);
 }
+
+void
+_shell_global_notify_shutdown (ShellGlobal *global)
+{
+  g_signal_emit (global, shell_global_signals[SHUTDOWN], 0);
+}